const babel = require('rollup-plugin-babel');
module.exports = function (config) {
    config.set({
        basePath: '',
        frameworks: ['mocha', 'chai'],
        files: [
            'src/index.js',
            'src/index.scss',
            './tests/help.js',
            './tests/*.spec.js',
            {
                pattern: '*/images/*',
                included: false
            }
        ],
        exclude: ['node_modules'],
        preprocessors: {
            'src/index.js': ['rollup'],
            'src/index.scss': ['sass']
        },
        plugins: [
            'karma-*',
            '@metahub/karma-sass-preprocessor'
        ],
        rollupPreprocessor: {
            plugins: [babel()],
            output: {
                format: 'iife',
                name: 'Viewer',
                sourcemap: 'inline'
            }
        },
        sassPreprocessor: {
            options: {sourcemap: true}
        },
        reporters: ['mocha'],
        autoWatch: true,
        browsers: ['Chrome'],
        singleRun: false,
        concurrency: Infinity
    })
}
